<?php
/*
 * @Author: lokei
 * @Date: 2022-08-02 21:19:38
 * @LastEditors: lokei
 * @LastEditTime: 2022-08-16 23:33:30
 * @Description: 
 */

namespace App\Http\Controllers\User;

use App\Common\Tools\ResultTool;
use App\Http\Controllers\Controller;
use App\Models\Ucenter\FansModel;

class InfoController extends Controller
{
    /**
     * Create a new controller instance.
     *
     * @return void
     */
    public function __construct()
    {
        //
    }

    public function ofMiniapp()
    {
        $user = auth('api')->user();
        $fans = FansModel::where('uid', '=', $user->uid)->where('platform', '=', 'miniapp')->first();
        $res = ResultTool::success();
        $res['data'] = [
            'uid' => $user->uid,
            'openid' => $fans->openid
        ];
        return $res;
    }

}
